#delimit;
set more off;


cd "C:\....\Replication files";
	
use "ENMI - replication.dta", clear;

/* Table A13, A14, A15 - varying the sample by party size	*/


/* Larger party sub-samples */

#delimit;
 set more off;
foreach i in 1 5 10{;
 #delimit;
 set more off;
 /* full	*/
xtreg pvote
	c.ensh_mi##i.inc_cab_l pvote_l
	c.GDPgrowth##i.inc_cab_l
	c.moderate##i.inc_cab_l
 majelect 
 if pvote_l>=`i', fe robust;
 
 
	mat list e(b);	
		 estimates store lgparties_full_`i';	

		 /* Opposition	*/
xtreg pvote
	c.ensh_mi
	pvote_l
	c.GDPgrowth
	c.moderate


 majelect  if inc_cab_l==0 & pvote_l>=`i'
, fe robust ;
		
		 estimates store lgparties_opp_`i';	
	
	/* Incumbent	*/	

	
	xtreg pvote
	c.ensh_mi#i.inc_cab_l
 pvote_l
	c.GDPgrowth#i.inc_cab_l
	c.moderate#i.inc_cab_l
	

 majelect  if inc_cab_l==1 & pvote_l>=`i'
, fe robust
 ;
		
		 estimates store lgparties_inc_`i';	
};


	 #delimit;
 esttab  lgparties_opp_1 lgparties_inc_1 lgparties_full_1
 using "figures\TableA13 - large parties over 1 perc.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "rmse Root Mean Squared Error" "ll Log-Likelihood" ) 
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ( "Opposition" "Incumbents" "Full") nogaps
		title (\label{})
order(ensh_mi 
1.inc_cab_l#c.ensh_mi 
moderate 
1.inc_cab_l#c.moderate
GDPgrowth
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 

 majelect pvote_l _cons ) 

keep(ensh_mi 1.inc_cab_l 
1.inc_cab_l#c.ensh_mi GDPgrowth 
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l#c.moderate
moderate majelect 
pvote_l _cons )  

 coeflabels(
ensh_mi "ENMI" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.ensh_mi "Incumbent X ENMI"
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
majelect "Majoritarian Election"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: The Dependent variable is percentage vote for the party.");

	 #delimit;
 esttab  lgparties_opp_5 lgparties_inc_5 lgparties_full_5
 using "figures\TableA14 - large parties over 5 perc.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "rmse Root Mean Squared Error" "ll Log-Likelihood" ) 
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ( "Opposition" "Incumbents" "Full") nogaps
		title (\label{})
order(ensh_mi 
1.inc_cab_l#c.ensh_mi 
moderate 
1.inc_cab_l#c.moderate
GDPgrowth
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 

 majelect pvote_l _cons ) 

keep(ensh_mi 1.inc_cab_l 
1.inc_cab_l#c.ensh_mi GDPgrowth 
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l#c.moderate
moderate majelect 
pvote_l _cons )  

 coeflabels(
ensh_mi "ENMI" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.ensh_mi "Incumbent X ENMI"
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
majelect "Majoritarian Election"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: The Dependent variable is percentage vote for the party.");


	 #delimit;
 esttab  lgparties_opp_10 lgparties_inc_10 lgparties_full_10
 using "figures\TableA15 - large parties over 10 perc.rtf", replace 
		b (%10.3f) se scalars("aic AIC" "bic BIC" "rmse Root Mean Squared Error" "ll Log-Likelihood" ) 
		obslast star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
		label mtitles ( "Opposition" "Incumbents" "Full") nogaps
		title (\label{})
order(ensh_mi 
1.inc_cab_l#c.ensh_mi 
moderate 
1.inc_cab_l#c.moderate
GDPgrowth
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l 

 majelect pvote_l _cons ) 

keep(ensh_mi 1.inc_cab_l 
1.inc_cab_l#c.ensh_mi GDPgrowth 
1.inc_cab_l#c.GDPgrowth 
1.inc_cab_l#c.moderate
moderate majelect 
pvote_l _cons )  

 coeflabels(
ensh_mi "ENMI" 
1.inc_cab_l "Incumbent"
1.inc_cab_l#c.ensh_mi "Incumbent X ENMI"
GDPgrowth "GDP Growth Rate" 
1.inc_cab_l#c.GDPgrowth "Incumbent X GDP Growth Rate"
1.inc_cab_l#c.moderate "Incumbent X Moderated Position"
moderate "Moderated Position"
majelect "Majoritarian Election"
pvote_l "% Vote{\sub t-1}"
_cons "Constant")
addnotes("Note: The Dependent variable is percentage vote for the party.");
